package com.beigai.imessage.dao.mapper.ext;

import com.beigai.imessage.dao.mapper.UserFriendPOMapper;
import com.beigai.imessage.user.dto.UserFriend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by xxl on 2017/5/16.
 */
@Mapper
public interface UserFriendPOMapperExt extends UserFriendPOMapper{

    @Select({" SELECT " +
            "  b.`code`," +
            "  b.`nickname` " +
            "  FROM" +
            "  user_friend a " +
            "  LEFT JOIN USER b " +
            "  ON a.`friend_code` = b.`code` " +
            "  WHERE a.`user_code` = #{code,jdbcType=VARCHAR}"})
    List<UserFriend> findFriends(String code);
}
